<template>
    <div class="app-container">
        <!-- <el-form inline
                 label-width="80px">
            <el-form-item label="选择品牌">
                <el-input style="width:150px"></el-input>
            </el-form-item>
            <el-form-item label="选择门店">
                <el-input style="width:150px"></el-input>
            </el-form-item>
            <el-form-item label="选择车系">
                <el-input style="width:150px"></el-input>
            </el-form-item>
            <el-form-item label="选择车型">
                <el-input style="width:150px"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary"
                           icon="el-icon-search"
                           size="mini"
                           @click="handleQuery">搜索</el-button>
                <el-button icon="el-icon-refresh"
                           size="mini"
                           @click="resetQuery">重置</el-button>
            </el-form-item>
        </el-form> -->

        <el-table v-loading="loading"
                  :data="list"
                  @selection-change="handleSelectionChange">
            <el-table-column type="selection"
                             width="55"
                             align="center"></el-table-column>
            <el-table-column label="方案id"></el-table-column>
            <el-table-column label="车型信息"></el-table-column>
            <el-table-column label="座位"></el-table-column>
            <el-table-column label="运营分类"></el-table-column>
            <el-table-column label="均价"></el-table-column>
        </el-table>
    </div>
</template>

<script>
import * as api from '@/api/member/member'

export default {
    props: ['storeId', 'startTime', 'endTime'],
    data() {
        return {
            list: [],
            selection: [],
            pageNum: 0,//页码   必选
            pageSize: 10//每页显示数据 必选
        };
    },
    computed: {
        formData() {
            const formData = {
                storeId: this.storeId,//预定取车门店  必传
                startTime: this.startTime,//租赁开始时间 必传
                endTime: this.endTime,//租赁结束时间 必传
                pageNum: this.pageNum,//页码   必选
                pageSize: this.pageSize,//每页显示数据 必选
            };
            return formData;
        },
    },
    mounted() {
        this.getData();
    },
    methods: {
        /** 抛出数据 */
        emitData() {
            return selection[0];
        },
        handleSelectionChange(selection) {
            this.selection = selection;
        },
        getData() {
            this.loading = true;
            api.listBasic(this.formData).then(res => {
                this.list = res.rows || [];
                this.loading = false;
            })
        },
    },
}
</script>
